<?php 
class dv_payments_model extends CI_Model {
        function __construct()
        {
                parent::__construct();        
                $this->load->helper("local");
                $this->load->helper('date');
                $this->load->database();
        } 
//START-----------------dv_payments-------------------------//              
    	function get_all_dv_payments()
        {
			    $this->load->database();
                $query = $this->db->query("select * from vendor_payments  order by load_no DESC");
			return $query->result();
        }
		function getSearchDv_Payment($search_value,$column_value)
       {    
		//$query = $this->db->query($sql . " order by " . $column_value . " asc Limit 10 ");
		$sql="select * from vendor_payments";
		$sql.=" where $column_value like '%$search_value%' ";
		$sql.="order by dv_payment_id ASC";
		
	  //echo $sql;
	 // exit;
		//$query = $this->db->query ("select * from vendor_payments where $column_value like '%$search_value%' order by dv_payment_id ASC Limit 10");
				$query = $this->db->query ($sql);
				return $query->result();
				
       }	
	
        function getdv_payments_info($code)
        {        
                $query = $this->db->query("select *from vendor_payments where dv_payment_id='$code'");
                 //return $query->result();
				 return $query->row();
        }
		
		 function getpaymentInfoBypaymentNo($load_no)
        {       $query = $this->db->query ("select * from vendor_payments where load_no='$load_no' ");
				return $query->row();
        }


//End-----------------dv_payments -------------------------//              		

}
?>
